package cbh.tool.scheduler.clietn;

import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.HttpClientBuilder;

/**
 * Created by hx-pc on 16-4-6.
 */
public class HttpClientTemplate {

    private static HttpClient httpClient;
    private static final Object sync = new Object();

    static {
        if (httpClient == null) {
            synchronized (sync) {
                if(httpClient == null) {
                    httpClient =  HttpClientBuilder.create().build();
                }
            }
        }
    }

    public static HttpClient getHttpClient() {
        return httpClient;
    }
}
